
sources =
sources += abs-time.cpp
sources += cooperative-condition.cpp
sources += cooperative-mutex.cpp
sources += fiber-context.cpp
sources += fiber-env.cpp
sources += fiber.cpp
sources += interlocked.cpp
sources += native-condition.cpp
sources += native-mutex.cpp
sources += native-rwlock.cpp
sources += thread.cpp
objects = $(sources:.cpp=.o)
target = libfiberenv.a

LONG_BIT=$(shell getconf LONG_BIT)
ifeq ($(LONG_BIT),64)
	ARCH=x86-64
else
	ARCH=x386
endif

all: $(target)
clean:
	rm -f $(target) $(objects)
check: all

$(target): $(objects)
	ar -r $(target) $(objects)

.cpp.o:
	g++ -c -o $@ -g -march=$(ARCH) $^

